package exception;

/** 异常的抛出 */
public class ThrowDemo {
    public static void main(String[] args) {
        Student zs = new Student();
        try{
            zs.setAge(1000);
        }catch(IllegalAgeException e){
            System.out.println("发生异常并处理了");
        }
        System.out.println("此人年龄为："+zs.getAge()+"岁");

    }
}
